package com.baomidou.blog.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * <p>
 * 根目录相关访问
 * </p>
 * 
 * @author hubin
 *
 */
@Controller
public class IndexController extends BaseController {

	/**
	 * blog 首页
	 */
	@RequestMapping("/")
	public String index(Model model) {
		model.addAttribute("menu", "content");
		return "blog/blog";
	}

	@RequestMapping("/admin")
	public String index(ModelMap map) {
		map.addAttribute("host", "http://blog.baomidou.com");
		return "admin/admin";
	}

	@RequestMapping("/blog")
	public String blog(ModelMap map) {

		map.addAttribute("menu", "content");
		return "blog/blog";
	}

	@RequestMapping("/archives")
	public String archive(ModelMap map) {

		map.addAttribute("menu", "archives");
		return "blog/blog";
	}

}
